package sample;

import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.control.Button;
import javafx.scene.layout.AnchorPane;

import java.io.IOException;

public class Controller {

    @FXML
    private AnchorPane rootPane;

    public void switch_view() throws IOException {
        AnchorPane other = FXMLLoader.load(getClass().getResource("SecondPane.fxml"));
        rootPane.getChildren().clear();
        rootPane.getChildren().setAll(other.getChildren());
    }
}
